package com.controller.base;


public class BaseController {

    public static final int SUCCESS_CODE = 200;
    public static final int FAIL_CODE = 50000;
    public static final int DENIED = 666;

    public static Response success() {
        return new Response().setCode(SUCCESS_CODE);
    }
    public static Response success(Object data) {
        return success().setData(data);
    }
    public static Response success(String data) {
        return success().setMsg(data);
    }
    public static Response success(String msg, Object data) {
        return success().setMsg(msg).setData(data);
    }
    public static Response fail() {
        return new Response().setCode(FAIL_CODE);
    }
    public static Response fail(Object data) {
        return fail().setData(data);
    }
    public static Response fail(String msg){
        return fail().setMsg(msg);
    }
    public static Response fail(String msg, Object data) {
        return fail().setMsg(msg).setData(data);
    }
}
